#include<iostream>
#include<cstring>
#include<vector>
#include<cmath>
using namespace std;

int main(){
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    
    int n,k;
    cin>>n>>k;
    
    vector<int> a(n,0), b(n,0);
    for(int i=0;i<n;i++) cin>>a[i];
    for(int i=0;i<n;i++) cin>>b[i];
    
    bool f[n][2];
    memset(f,false,sizeof f);
    f[0][0]=f[0][1]=true;
    
    for(int i=1;i<n;i++){
        if(f[i-1][0] && abs(a[i]-a[i-1])<=k || f[i-1][1] && abs(a[i]-b[i-1])<=k)
            f[i][0]=true;
        if(f[i-1][0] && abs(b[i]-a[i-1])<=k || f[i-1][1] && abs(b[i]-b[i-1])<=k)
            f[i][1]=true;
    }
    
    if(f[n-1][0] | f[n-1][1]) cout<<"Yes\n";
    else cout<<"No\n";
    
    return 0;
}
